/*
 *此javaCode由YMS-JDBC替换工具生成，原mapper位置com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper
 */
package com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.impl;

import com.yonyou.iuap.yms.api.IYmsJdbcApi;
import com.yonyou.iuap.yms.param.ResultSetProcessor;
import com.yonyou.iuap.yms.param.SQLParameter;
import com.yonyou.iuap.yms.processor.AutoBeanListProcessor;
import com.yonyou.iuap.yms.processor.AutoBeanProcessor;
import com.yonyou.iuap.yms.processor.ColumnProcessor;
import com.yonyou.iuap.yms.replace.CollectionUtil;
import com.yonyou.ucf.mdf.app.isvdxq.firstpart.RFIDCodeDetail.model.CoderfidViewBean;
import com.yonyou.ucf.mdf.app.isvdxq.secondpart.entity.EpcEntity;
import com.yonyou.ucf.mdf.app.isvdxq.secondpart.model.ReactEpcpageEntity;
import com.yonyou.ucf.mdf.app.isvdxq.secondpart.model.ReactEpcpageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.Types;
import java.util.List;

@Repository
public class EpclistMapperImpl {
    
    @Autowired
    private IYmsJdbcApi ymsJdbcApi;
    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.updateInvalidDate
    
    public int updateInvalidDate(List<String> idlist, String invalidDate, String modifier, String tenant_id, String batch_no) throws Exception {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		//sqlBuilder.append(" update dxq_coderfid set rfid_status=0,invalidDate=?,modifier=?,modify_time=now(),batch_no=? where id in ");
		sqlBuilder.append(" update dxq_coderfid set invalidDate=?,modifier=?,modify_time=now(),batch_no=? ");
		parameter.addParam(invalidDate);
		parameter.addParam(modifier);
		parameter.addParam(batch_no);
		sqlBuilder.append(" where ytenant_id=? and dr=0 ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(idlist)) {
			sqlBuilder.append(" and id in ( ");
			String separator0 = " , ";
			for (int index = 0; index < idlist.size(); index++) {
				String item = idlist.get(index);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (index < idlist.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(" ) ");
		}else{
			sqlBuilder.append(" and id in ( '' )");
		}
        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectByIds
    
    public List<EpcEntity> selectByIds(List<String> strList, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select * from dxq_coderfid where `dr`=0 ");
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and id in (");
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(")");
		}
		sqlBuilder.append(" and ytenant_id=?; ");
		parameter.addParam(tenant_id);

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectByWIds
    
    public List<EpcEntity> selectByWIds(List<String> strList, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select * from dxq_coderfid where `dr`=0 ");
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and warehouse_id in ( ");
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(")");
		}
		sqlBuilder.append(" and ytenant_id=?; ");
		parameter.addParam(tenant_id);

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.editStatus
    
    public int editStatus(List<String> strList, String modifier, String rfid_status, String tenant_id) throws Exception {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" update dxq_coderfid set modify_time=now(),modifier=?, rfid_status=? ");
		parameter.addParam(modifier);
		parameter.addParam(rfid_status);
		sqlBuilder.append(" where ytenant_id=? and dr=0 ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and id in ( ");
			String separator0 = " , ";
			for (int index = 0; index < strList.size(); index++) {
				String item = strList.get(index);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (index < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(" ) ");
		}else {
			sqlBuilder.append(" and id in ( '' )");
		}
        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.insert
    
    public int insert(EpcEntity record) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "insert into dxq_coderfid (`id`, `epc_tid`,  `rfid_code`, `product_id`,  `product_name`, `product_sku_id`,  `product_sku_name`, `f_stock_count`,  `warehouse_id`, `warehouse_code`,  `shelf_id`, `location_id`,  `source_code`, `rfid_status`,  `is_split`, `f_move_count`,  `f_out_count`, `unitId`,  `unit_name`, `stockUnitId`,  `stock_unit_name`, `dr`,  `ytenant_id`, `pk_temp`,  `version`, `create_time`,  `modify_time`, `picktime`,  `pickuser`, `creator`,  `modifier`, `pubts`,  `batchno`, `productDate`,  `invalidDate`, `remark`,`batch_no`) values (?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?, ?)\n";
        parameter.addParamWithType(record.getId(), Types.VARCHAR);
		parameter.addParamWithType(record.getEpc_tid(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getF_stock_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getWarehouse_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getWarehouse_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getShelf_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getLocation_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getSource_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_status(), Types.INTEGER);
		parameter.addParamWithType(record.getIs_split(), Types.INTEGER);
		parameter.addParamWithType(record.getF_move_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getF_out_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getUnit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getStockUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getStock_unit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getDr(), Types.SMALLINT);
		parameter.addParamWithType(record.getYtenant_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getPk_temp(), Types.VARCHAR);
		parameter.addParamWithType(record.getVersion(), Types.INTEGER);
		parameter.addParamWithType(record.getCreate_time(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getModify_time(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getPicktime(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getPickuser(), Types.VARCHAR);
		parameter.addParamWithType(record.getCreator(), Types.VARCHAR);
		parameter.addParamWithType(record.getModifier(), Types.VARCHAR);
		parameter.addParamWithType(record.getPubts(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getBatchno(), Types.VARCHAR);
		parameter.addParamWithType(record.getProductDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getInvalidDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getRemark(), Types.VARCHAR);
		parameter.addParamWithType(record.getBatch_no(), Types.VARCHAR);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.editStatusForPick
    
    public int editStatusForPick(List<String> ids, String modifier, String rfid_status, String tenant_id) throws Exception {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" update dxq_coderfid set modify_time=now(),modifier=?,rfid_status=?,pickuser=? ");
		parameter.addParam(modifier);
		parameter.addParam(rfid_status);
		parameter.addParam(modifier);
		sqlBuilder.append(" where ytenant_id=? and dr=0 ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(ids)) {
			sqlBuilder.append(" and id in ( ");
			String separator0 = " , ";
			for (int index = 0; index < ids.size(); index++) {
				String item = ids.get(index);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (index < ids.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(" ) ");
		}else{
			sqlBuilder.append(" and id in ( '' )");
		}
        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.updateByPrimaryKey
    
    public int updateByPrimaryKey(EpcEntity record) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "update dxq_coderfid set `epc_tid` = ?, `rfid_code` = ?, `product_id` = ?, `product_name` = ?, `product_sku_id` = ?, `product_sku_name` = ?, `f_stock_count` = ?, `f_move_count` = ?, `f_out_count` = ?, `warehouse_id` = ?, `warehouse_code` = ?, `shelf_id` = ?, `location_id` = ?, `source_code` = ?, `rfid_status` = ?, `is_split` = ?, `unitId` = ?, `unit_name` = ?, `stockUnitId` = ?, `stock_unit_name` = ?, `dr` = ?, `version` = ?, `pk_temp` = ?, `modify_time` = ?, `picktime` = ?, `pickuser` = ?, `creator` = ?, `modifier` = ?, `batchno` = ?, `productDate` = ?, `remark` = ?, `batch_no` = ?, `invalidDate` = ? where `id` = ?\n";
        parameter.addParamWithType(record.getEpc_tid(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getF_stock_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getF_move_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getF_out_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getWarehouse_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getWarehouse_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getShelf_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getLocation_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getSource_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_status(), Types.INTEGER);
		parameter.addParamWithType(record.getIs_split(), Types.INTEGER);
		parameter.addParamWithType(record.getUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getUnit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getStockUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getStock_unit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getDr(), Types.INTEGER);
		parameter.addParamWithType(record.getVersion(), Types.INTEGER);
		parameter.addParamWithType(record.getPk_temp(), Types.VARCHAR);
		parameter.addParamWithType(record.getModify_time(), Types.VARCHAR);
		parameter.addParamWithType(record.getPicktime(), Types.VARCHAR);
		parameter.addParamWithType(record.getPickuser(), Types.VARCHAR);
		parameter.addParamWithType(record.getCreator(), Types.VARCHAR);
		parameter.addParamWithType(record.getModifier(), Types.VARCHAR);
		parameter.addParamWithType(record.getBatchno(), Types.VARCHAR);
		parameter.addParamWithType(record.getProductDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getRemark(), Types.VARCHAR);
		parameter.addParamWithType(record.getBatch_no(), Types.VARCHAR);
		parameter.addParamWithType(record.getInvalidDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getId(), Types.VARCHAR);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.insertHistory
    
    public int insertHistory(EpcEntity record) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "insert into dxq_coderfidhistory (`id`, `epc_tid`,  `rfid_code`, `product_id`,  `product_name`, `product_sku_id`,  `product_sku_name`, `f_stock_count`,  `warehouse_id`, `warehouse_code`,  `shelf_id`, `location_id`,  `source_code`, `rfid_status`,  `is_split`, `f_move_count`,  `f_out_count`, `unitId`,  `unit_name`, `stockUnitId`,  `stock_unit_name`, `dr`,  `ytenant_id`, `pk_temp`,  `version`, `create_time`,  `modify_time`, `picktime`,  `pickuser`, `creator`,  `modifier`, `pubts`,  `batchno`, `productDate`,  `invalidDate`, `remark`, `batch_no`) values (?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?,  ?, ?, ?)\n";
        parameter.addParamWithType(record.getId(), Types.VARCHAR);
		parameter.addParamWithType(record.getEpc_tid(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getProduct_sku_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getF_stock_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getWarehouse_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getWarehouse_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getShelf_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getLocation_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getSource_code(), Types.VARCHAR);
		parameter.addParamWithType(record.getRfid_status(), Types.INTEGER);
		parameter.addParamWithType(record.getIs_split(), Types.INTEGER);
		parameter.addParamWithType(record.getF_move_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getF_out_count(), Types.DECIMAL);
		parameter.addParamWithType(record.getUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getUnit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getStockUnitId(), Types.VARCHAR);
		parameter.addParamWithType(record.getStock_unit_name(), Types.VARCHAR);
		parameter.addParamWithType(record.getDr(), Types.SMALLINT);
		parameter.addParamWithType(record.getYtenant_id(), Types.VARCHAR);
		parameter.addParamWithType(record.getPk_temp(), Types.VARCHAR);
		parameter.addParamWithType(record.getVersion(), Types.INTEGER);
		parameter.addParamWithType(record.getCreate_time(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getModify_time(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getPicktime(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getPickuser(), Types.VARCHAR);
		parameter.addParamWithType(record.getCreator(), Types.VARCHAR);
		parameter.addParamWithType(record.getModifier(), Types.VARCHAR);
		parameter.addParamWithType(record.getPubts(), Types.TIMESTAMP);
		parameter.addParamWithType(record.getBatchno(), Types.VARCHAR);
		parameter.addParamWithType(record.getProductDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getInvalidDate(), Types.VARCHAR);
		parameter.addParamWithType(record.getRemark(), Types.VARCHAR);
		parameter.addParamWithType(record.getBatch_no(), Types.VARCHAR);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.updateByPrimaryKeys
    
    public int updateByPrimaryKeys(List<EpcEntity> strList, String modifier, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		if (CollectionUtil.isNotEmpty(strList)) {
			String separator0 = " ; ";
			for (int i = 0; i < strList.size(); i++) {
				EpcEntity item = strList.get(i);
				sqlBuilder.append(" update dxq_coderfid set `warehouse_code` = ?, `stockUnitId` = ?, `stock_unit_name` = ?, `invalidDate` = ?, `remark` = ?, `batch_no` = ?, `modify_time` = now(), `modifier` = ? where `id` =? and ytenant_id=? AND `dr`=0 ");
				parameter.addParamWithType(item.getWarehouse_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getStockUnitId(), Types.VARCHAR);
				parameter.addParamWithType(item.getStock_unit_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getInvalidDate(), Types.VARCHAR);
				parameter.addParamWithType(item.getRemark(), Types.VARCHAR);
				parameter.addParamWithType(item.getBatch_no(), Types.VARCHAR);
				parameter.addParamWithType(item.getModifier(), Types.VARCHAR);
				parameter.addParam(item.getId());
				parameter.addParam(item.getYtenant_id());
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
		}

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.editStatusForAllot
    
    public int editStatusForAllot(List<String> strList, String tenant_id, String modifier, String epc_status) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" update dxq_coderfid set modify_time=now(), modifier=?, rfid_status=? ");
		parameter.addParam(modifier);
		parameter.addParam(epc_status);
		sqlBuilder.append(" where ytenant_id=? and dr=0 and rfid_status=4 ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and rfid_code in ( ");
			String separator0 = " , ";
			for (int index = 0; index < strList.size(); index++) {
				String item = strList.get(index);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (index < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(" ) ");
		}

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectEpctip
    
    public List<CoderfidViewBean> selectEpctip(String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "SELECT SUM(`f_stock_count`) as f_stock_count,'' as locationName, warehouse_id,tenant_id,invalidDate,\n" + 
			         "product_id,product_sku_id,batchno,`productDate`,location_id                                         \n" + 
			         "FROM `dxq_coderfid`                                                                                 \n" + 
			         "WHERE dr=0 and ytenant_id=? and rfid_status in(1,0)                                                  \n" +
			         "GROUP BY `product_id`,product_sku_id,batchno,`productDate`,location_id                              \n" + 
			         "order by invalidDate asc;                                                                           \n";
        parameter.addParam(tenant_id);

        ResultSetProcessor processor = new AutoBeanListProcessor(new CoderfidViewBean());
        return (List<CoderfidViewBean>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.insertBatchHistory
    
    public int insertBatchHistory(List<EpcEntity> insertBatch) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" insert into dxq_coderfidhistory (`id`, `epc_tid`, `rfid_code`, `product_id`, `product_name`, `product_sku_id`, `product_sku_name`, `f_stock_count`, `warehouse_id`, `warehouse_code`, `shelf_id`, `location_id`, `source_code`, `rfid_status`, `is_split`, `f_move_count`, `f_out_count`, `unitId`, `unit_name`, `stockUnitId`, `stock_unit_name`, `dr`, `ytenant_id`, `pk_temp`, `version`, `create_time`, `modify_time`, `picktime`, `pickuser`, `creator`, `modifier`, `pubts`, `batchno`, `productDate`, `invalidDate`, `remark`, `batch_no`) values ");
		if (CollectionUtil.isNotEmpty(insertBatch)) {
			String separator0 = " , ";
			for (int i = 0; i < insertBatch.size(); i++) {
				EpcEntity item = insertBatch.get(i);
				sqlBuilder.append(" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ");
				parameter.addParamWithType(item.getId(), Types.VARCHAR);
				parameter.addParamWithType(item.getEpc_tid(), Types.VARCHAR);
				parameter.addParamWithType(item.getRfid_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_sku_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_sku_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getF_stock_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getWarehouse_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getWarehouse_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getShelf_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getLocation_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getSource_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getRfid_status(), Types.INTEGER);
				parameter.addParamWithType(item.getIs_split(), Types.INTEGER);
				parameter.addParamWithType(item.getF_move_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getF_out_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getUnitId(), Types.VARCHAR);
				parameter.addParamWithType(item.getUnit_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getStockUnitId(), Types.VARCHAR);
				parameter.addParamWithType(item.getStock_unit_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getDr(), Types.SMALLINT);
				parameter.addParamWithType(item.getYtenant_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getPk_temp(), Types.VARCHAR);
				parameter.addParamWithType(item.getVersion(), Types.INTEGER);
				parameter.addParamWithType(item.getCreate_time(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getModify_time(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getPicktime(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getPickuser(), Types.VARCHAR);
				parameter.addParamWithType(item.getCreator(), Types.VARCHAR);
				parameter.addParamWithType(item.getModifier(), Types.VARCHAR);
				parameter.addParamWithType(item.getPubts(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getBatchno(), Types.VARCHAR);
				parameter.addParamWithType(item.getProductDate(), Types.VARCHAR);
				parameter.addParamWithType(item.getInvalidDate(), Types.VARCHAR);
				parameter.addParamWithType(item.getRemark(), Types.VARCHAR);
				parameter.addParamWithType(item.getBatch_no(), Types.VARCHAR);
				if (i < insertBatch.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
		}
		sqlBuilder.append(" ON DUPLICATE KEY UPDATE epc_tid=VALUES(epc_tid),rfid_code=VALUES(rfid_code) ,f_stock_count=VALUES(f_stock_count),rfid_status=VALUES(rfid_status) ,warehouse_id=VALUES(warehouse_id),warehouse_code=VALUES(warehouse_code) ,shelf_id=VALUES(shelf_id),location_id=VALUES(location_id) ,source_code=VALUES(source_code),is_split=VALUES(is_split) ,f_move_count=VALUES(f_move_count),f_out_count=VALUES(f_out_count) ,modify_time=VALUES(modify_time),modifier=VALUES(modifier) ,invalidDate=VALUES(invalidDate),productDate=VALUES(productDate) ,unitId=VALUES(unitId),stockUnitId=VALUES(stockUnitId) ,batchno=VALUES(batchno),pickuser=VALUES(pickuser) ");

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectPage
    
    public List<EpcEntity> selectPage(String tenant_id, int m, int n) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select * from dxq_coderfid where `ytenant_id` = ? limit ?,?;\n";
        parameter.addParam(tenant_id);
		parameter.addParam(m);
		parameter.addParam(n);

        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectEpctipForPick
    
    public List<CoderfidViewBean> selectEpctipForPick(String product_id, String product_sku_id, String warehouse_id, String batchno, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" SELECT SUM(`f_stock_count`) as f_stock_count,'' as locationName, warehouse_id,tenant_id,invalidDate, product_id,product_sku_id,batchno,`productDate`,location_id FROM `dxq_coderfid` WHERE dr=0 and ytenant_id=? and rfid_status in(1,0) and (!ISNULL(location_id) and location_id!='') ");
		parameter.addParam(tenant_id);
		if (batchno != null && !"".equals(batchno)) {
			sqlBuilder.append(" and batchno=? ");
			parameter.addParam(batchno);
		}
		sqlBuilder.append(" and warehouse_id=? and product_id=? and product_sku_id=? GROUP BY `product_id`,product_sku_id,batchno,`productDate`,location_id order by invalidDate asc; ");
		parameter.addParam(warehouse_id);
		parameter.addParam(product_id);
		parameter.addParam(product_sku_id);

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new CoderfidViewBean());
        return (List<CoderfidViewBean>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.editForShangjia
    
    public int editForShangjia(List<EpcEntity> entityList, String tenant_id) throws Exception {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		if (CollectionUtil.isNotEmpty(entityList)) {
			String separator0 = " ; ";
			for (int i = 0; i < entityList.size(); i++) {
				EpcEntity item = entityList.get(i);
				sqlBuilder.append(" update dxq_coderfid set rfid_status=?, modify_time=now(), modifier=?, warehouse_id=?, warehouse_code=?, shelf_id=?, location_id=? where id=? and ytenant_id=? and dr=0 ");
				parameter.addParamWithType(item.getRfid_status(), Types.INTEGER);
				parameter.addParamWithType(item.getModifier(), Types.VARCHAR);
				parameter.addParamWithType(item.getWarehouse_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getWarehouse_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getShelf_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getLocation_id(), Types.VARCHAR);
				parameter.addParam(item.getId());
				parameter.addParam(item.getYtenant_id());
				if (i < entityList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
		}

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }


    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectByEpc
    
    public EpcEntity selectByEpc(String epc, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select * from dxq_coderfid where `dr`=0 and rfid_code=? and ytenant_id=? limit 1;\n";
        parameter.addParam(epc);
		parameter.addParam(tenant_id);

        ResultSetProcessor processor = new AutoBeanProcessor(new EpcEntity());
        return (EpcEntity) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectByLIds
    
    public List<EpcEntity> selectByLIds(List<String> strList, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select * from dxq_coderfid where `dr`=0 and ytenant_id=? ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and location_id in ( ");
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParam(item);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(")");
		}

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectById
    
    public EpcEntity selectById(String id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select * from dxq_coderfid where `id`=? limit 1;\n";
        parameter.addParam(id);

        ResultSetProcessor processor = new AutoBeanProcessor(new EpcEntity());
        return (EpcEntity) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectAll
    
    public List<EpcEntity> selectAll(String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "select * from dxq_coderfid where `ytenant_id` = ?;\n";
        parameter.addParam(tenant_id);

        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectPageForReactCount
    
    public int selectPageForReactCount(String tenant_id, ReactEpcpageParam entity) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select count(1) from (select a.id from dxq_coderfid a left join dxq_location as t on t.id = a.location_id inner join dxqyy_warehouse as dl on a.warehouse_id = dl.id where a.`ytenant_id` = ? and a.dr=0 and a.rfid_status != 7 ");
		parameter.addParam(tenant_id);
		if (entity.getProduct_name() != null && !"".equals(entity.getProduct_name())) {
			sqlBuilder.append(" and a.product_name like concat('%',?,'%') ");
			parameter.addParam(entity.getProduct_name());
		}
		if (entity.getProduct_sku_name() != null && !"".equals(entity.getProduct_sku_name())) {
			sqlBuilder.append(" and a.product_sku_name like concat('%',?,'%') ");
			parameter.addParam(entity.getProduct_sku_name());
		}
		if (entity.getWarehouse_name() != null && !"".equals(entity.getWarehouse_name())) {
			sqlBuilder.append(" and dl.warehouseName like concat('%',?,'%') ");
			parameter.addParam(entity.getWarehouse_name());
		}
		if (entity.getLocationCode() != null && !"".equals(entity.getLocationCode())) {
			sqlBuilder.append(" and t.locationCode like concat('%',?,'%') ");
			parameter.addParam(entity.getLocationCode());
		}
		if (entity.getLocationName() != null && !"".equals(entity.getLocationName())) {
			sqlBuilder.append(" and t.locationName like concat('%',?,'%') ");
			String locationName = entity.getLocationName();
			String[] arr = entity.getLocationName().split("-");
			if (arr.length>1) locationName = arr[1];
			parameter.addParam(locationName);
		}
		if (entity.getRfid_code() != null && !"".equals(entity.getRfid_code())) {
			sqlBuilder.append(" and t.rfid_code like concat('%',?,'%') ");
			parameter.addParam(entity.getRfid_code());
		}
		sqlBuilder.append(" group by a.warehouse_id,a.location_id,a.product_id ) as t; ");

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new ColumnProcessor(int.class);
        return (int) ymsJdbcApi.queryForObject(sql, parameter, processor);
    }

	//com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectPageForReact

	public List<ReactEpcpageEntity> selectPageForReact(String tenant_id, int m, int n, ReactEpcpageParam entity) {
		SQLParameter parameter = new SQLParameter(true);
		StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select concat(t.parent_name,'-',t.locationName) as locationName,t.locationCode,t.rfid_code, dl.warehouseName as warehouse_name,a.location_id as id,a.warehouse_id,a.rfid_code as epccode, product_name,product_sku_name,product_id,SUM(f_stock_count) as f_stock_count from dxq_coderfid a left join dxq_location as t on t.id = a.location_id inner join dxqyy_warehouse as dl on a.warehouse_id = dl.id where a.`ytenant_id` = ? and a.dr=0 and a.rfid_status != 7 ");
		parameter.addParam(tenant_id);
		if (entity.getProduct_name() != null && !"".equals(entity.getProduct_name())) {
			sqlBuilder.append(" and a.product_name like concat('%',?,'%') ");
			parameter.addParam(entity.getProduct_name());
		}
		if (entity.getProduct_sku_name() != null && !"".equals(entity.getProduct_sku_name())) {
			sqlBuilder.append(" and a.product_sku_name like concat('%',?,'%') ");
			parameter.addParam(entity.getProduct_sku_name());
		}
		if (entity.getWarehouse_name() != null && !"".equals(entity.getWarehouse_name())) {
			sqlBuilder.append(" and dl.warehouseName like concat('%',?,'%') ");
			parameter.addParam(entity.getWarehouse_name());
		}
		if (entity.getLocationCode() != null && !"".equals(entity.getLocationCode())) {
			sqlBuilder.append(" and t.locationCode like concat('%',?,'%') ");
			parameter.addParam(entity.getLocationCode());
		}
		if (entity.getLocationName() != null && !"".equals(entity.getLocationName())) {
			sqlBuilder.append(" and t.locationName like concat('%',?,'%') ");
			String locationName = entity.getLocationName();
			String[] arr = entity.getLocationName().split("-");
			if (arr.length>1) locationName = arr[1];
			parameter.addParam(locationName);
		}
		if (entity.getRfid_code() != null && !"".equals(entity.getRfid_code())) {
			sqlBuilder.append(" and t.rfid_code like concat('%',?,'%') ");
			parameter.addParam(entity.getRfid_code());
		}
		sqlBuilder.append(" group by a.warehouse_id,a.location_id,a.product_id order by a.product_id asc limit ?,?; ");
		parameter.addParam(m);
		parameter.addParam(n);


		String sql = sqlBuilder.toString();
		ResultSetProcessor processor = new AutoBeanListProcessor(new ReactEpcpageEntity());
		return (List<ReactEpcpageEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
	}

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.insertBatch
    
    public int insertBatch(List<EpcEntity> insertBatch) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" insert into dxq_coderfid (`id`, `epc_tid`, `rfid_code`, `product_id`, `product_name`, `product_sku_id`, `product_sku_name`, `f_stock_count`, `warehouse_id`, `warehouse_code`, `shelf_id`, `location_id`, `source_code`, `rfid_status`, `is_split`, `f_move_count`, `f_out_count`, `unitId`, `unit_name`, `stockUnitId`, `stock_unit_name`, `dr`, `ytenant_id`, `pk_temp`, `version`, `create_time`, `modify_time`, `picktime`, `pickuser`, `creator`, `modifier`, `pubts`, `batchno`, `productDate`, `invalidDate`, `remark`,`batch_no`) values ");
		if (CollectionUtil.isNotEmpty(insertBatch)) {
			String separator0 = " , ";
			for (int i = 0; i < insertBatch.size(); i++) {
				EpcEntity item = insertBatch.get(i);
				sqlBuilder.append(" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ");
				parameter.addParamWithType(item.getId(), Types.VARCHAR);
				parameter.addParamWithType(item.getEpc_tid(), Types.VARCHAR);
				parameter.addParamWithType(item.getRfid_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_sku_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getProduct_sku_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getF_stock_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getWarehouse_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getWarehouse_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getShelf_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getLocation_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getSource_code(), Types.VARCHAR);
				parameter.addParamWithType(item.getRfid_status(), Types.INTEGER);
				parameter.addParamWithType(item.getIs_split(), Types.INTEGER);
				parameter.addParamWithType(item.getF_move_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getF_out_count(), Types.DECIMAL);
				parameter.addParamWithType(item.getUnitId(), Types.VARCHAR);
				parameter.addParamWithType(item.getUnit_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getStockUnitId(), Types.VARCHAR);
				parameter.addParamWithType(item.getStock_unit_name(), Types.VARCHAR);
				parameter.addParamWithType(item.getDr(), Types.SMALLINT);
				parameter.addParamWithType(item.getYtenant_id(), Types.VARCHAR);
				parameter.addParamWithType(item.getPk_temp(), Types.VARCHAR);
				parameter.addParamWithType(item.getVersion(), Types.INTEGER);
				parameter.addParamWithType(item.getCreate_time(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getModify_time(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getPicktime(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getPickuser(), Types.VARCHAR);
				parameter.addParamWithType(item.getCreator(), Types.VARCHAR);
				parameter.addParamWithType(item.getModifier(), Types.VARCHAR);
				parameter.addParamWithType(item.getPubts(), Types.TIMESTAMP);
				parameter.addParamWithType(item.getBatchno(), Types.VARCHAR);
				parameter.addParamWithType(item.getProductDate(), Types.VARCHAR);
				parameter.addParamWithType(item.getInvalidDate(), Types.VARCHAR);
				parameter.addParamWithType(item.getRemark(), Types.VARCHAR);
				parameter.addParamWithType(item.getBatch_no(), Types.VARCHAR);
				if (i < insertBatch.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
		}
		sqlBuilder.append(" ON DUPLICATE KEY UPDATE epc_tid=VALUES(epc_tid),rfid_code=VALUES(rfid_code) ,f_stock_count=VALUES(f_stock_count),rfid_status=VALUES(rfid_status) ,warehouse_id=VALUES(warehouse_id),warehouse_code=VALUES(warehouse_code) ,shelf_id=VALUES(shelf_id),location_id=VALUES(location_id) ,source_code=VALUES(source_code),is_split=VALUES(is_split) ,f_move_count=VALUES(f_move_count),f_out_count=VALUES(f_out_count) ,modify_time=VALUES(modify_time),modifier=VALUES(modifier) ,invalidDate=VALUES(invalidDate),productDate=VALUES(productDate) ,unitId=VALUES(unitId),stockUnitId=VALUES(stockUnitId) ,batchno=VALUES(batchno), pickuser=VALUES(pickuser) ,remark=VALUES(remark), batch_no=VALUES(batch_no) ");

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.deleteByPrimaryKey
    
    public int deleteByPrimaryKey(String id) {
        SQLParameter parameter = new SQLParameter(true);
        
        String sql = "delete from dxq_coderfid where `id` = ?\n";
        parameter.addParamWithType(id, Types.VARCHAR);

        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.selectByEpcs
    
    public List<EpcEntity> selectByEpcs(List<String> strList, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" select * from dxq_coderfid where `dr`=0 ");
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and rfid_code in ( ");
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParamWithType(item, Types.VARCHAR);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(" ) ");
		}
		sqlBuilder.append(" and ytenant_id=?; ");
		parameter.addParam(tenant_id);

        
        String sql = sqlBuilder.toString();
        ResultSetProcessor processor = new AutoBeanListProcessor(new EpcEntity());
        return (List<EpcEntity>) ymsJdbcApi.queryForList(sql, parameter, processor);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.deleteByIds
    
    public int deleteByIds(List<String> strList, String tenant_id) {
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" delete from dxq_coderfid where ytenant_id=? ");
		parameter.addParam(tenant_id);
		if (CollectionUtil.isNotEmpty(strList)) {
			sqlBuilder.append(" and id in (");
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParamWithType(item, Types.VARCHAR);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
			sqlBuilder.append(")");
		}else{
			sqlBuilder.append(" and id in('')");
		}

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

    //com.yonyou.ucf.mdf.app.isvdxq.secondpart.mapper.EpclistMapper.deleteByEpcs
    
    public int deleteByEpcs(List<String> strList, String tenant_id) {
		if (strList == null || strList.size()==0) return 0;
        SQLParameter parameter = new SQLParameter(true);
        StringBuilder sqlBuilder = new StringBuilder();
		sqlBuilder.append(" delete from dxq_coderfid where rfid_code in ( ");
		if (CollectionUtil.isNotEmpty(strList)) {
			String separator0 = " , ";
			for (int i = 0; i < strList.size(); i++) {
				String item = strList.get(i);
				sqlBuilder.append(" ? ");
				parameter.addParamWithType(item, Types.VARCHAR);
				if (i < strList.size() - 1) {
					sqlBuilder.append(separator0);
				}
			}
		}
		sqlBuilder.append(" ) and ytenant_id=? and dr=0; ");
		parameter.addParam(tenant_id);

        
        String sql = sqlBuilder.toString();
        
        return ymsJdbcApi.update(sql, parameter);
    }

}
